#ifndef IVALIDATORINTERFACE_H_
#define IVALIDATORINTERFACE_H_

#include <iostream>

namespace zl {

/// \brief ITL 纸币器事件监听
class IValidatorObserver
{
public:
    virtual ~IValidatorObserver() {}

    /// \brief 纸币器接收到纸币事件
    virtual void EventCredit(int32_t value, const std::string& currency) = 0;
};

/// \brief 纸币器接口类
class IValidatorInterface
{
public:
    enum EValidatorType {
        EValidatorType_ITL = 0x01,
        EValidatorType_MEI,
        EValidatorType_YD_M175
    };

    virtual ~IValidatorInterface() = default;

    /// \brief 初始化纸币器设备
    virtual int32_t Initialize(const std::string& com, int32_t baud, zl::IValidatorObserver* obs) = 0;

    /// \brief 反初始化纸币器设备
    virtual int32_t Uninitialize() = 0;

    /// \brief 获取纸币器当前的状态
    virtual int32_t Status() = 0;

    /// \brief 重置纸币器
    virtual int32_t Reset() = 0;

    /// \brief 设置纸币器设备（设置通道信息等）
    virtual int32_t Setup() = 0;

    /// \brief 启用纸币器
    /// \note 启用纸币器设备后，纸币器开始收钱
    virtual int32_t Enable() = 0;

    /// \brief 禁用纸币器
    virtual int32_t Disable() = 0;
};

}

#endif // IVALIDATORINTERFACE_H_

